from calendar import month

type = input("请输入您要选择的贷款类型:1.商业贷款 2.公积金贷款 3.组合贷款")
money = int(input("请输入贷款金额(万元):"))
year = int(input("请输入贷款期限(年):5、10、15、20、25:"))
month = year * 12
if type == "2" and year <= 5:
    r = 0.0275/12
    g = money * (r * (1+r) ** month) / ((1+r) ** month - 1)
    print(f'每月月供参考(元):{g}')
    total = g * month
    print(f'还款总额(元):{total}')
    L = total - money
    print(f'支付利息(元):{L}')
elif type == "2" and year > 5:
    r = 0.0325/12
    g = money * (r * (1+r) ** month) / ((1+r) ** month - 1)
    print(f'每月月供参考(元):{g}')
    total = g * month
    print(f'还款总额(元):{total}')
    L = total - money
    print(f'支付利息(元):{L}')
if type == "1" and year <= 5:
    r = 0.0475/12
    g = money * (r * (1+r) ** month) / ((1+r) ** month - 1)
    print(f'每月月供参考(元):{g}')
    total = g * month
    print(f'还款总额(元):{total}')
    L = total - money
    print(f'支付利息(元):{L}')
elif type == "1" and year > 5:
    r = 0.049/12
    g = money * (r * (1+r) ** month) / ((1+r) ** month - 1)
    print(f'每月月供参考(元):{g}')
    total = g * month
    print(f'还款总额(元):{total}')
    L = total - money
    print(f'支付利息(元):{L}')